package com.bestpay.demo2.service.aop;

import com.bestpay.drip.commons.validation.check.ArgumentsCheck;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * Service 切面
 *
 * @author liuxin
 * @date 2022-06-20
 */
@Component
@Aspect
public class ServiceAspect {

    @Around(value = "execution(public * com.bestpay.demo2.service..*Impl.*(..))")
    public Object doServiceAround(ProceedingJoinPoint pjp) throws Throwable {
        // 参数校验
        ArgumentsCheck.validateArgs(pjp.getArgs());
        return pjp.proceed();
    }
}
